import { TradeMark, TradeMarkResponseData } from './type'
import { AxiosResData } from '@/utils/api/common_type'
import request from '@/utils/request'

enum API {
  TRADEMARK_URL = '/admin/product/baseTrademark/',
  //添加品牌
  ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
  //修改已有品牌
  UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update',
  //删除已有品牌
  DELETE_URL = '/admin/product/baseTrademark/remove/'
}

// 请求品牌管理
export const getTrademark = (page: number, limit: number) => request.get<any, AxiosResData<TradeMarkResponseData>>(API.TRADEMARK_URL + `${page}/${limit}`)

// 添加品牌
export const postAddTrademark = (data: TradeMark) => {
  return request.post(API.ADDTRADEMARK_URL, data)
}

// 修改商品
export const putTrademark = (data: TradeMark) => {
  return request.put(API.UPDATETRADEMARK_URL, data)
}

// 删除商品
export const deleteTrademark = (id: number) => {
  return request.delete(API.DELETE_URL + id)
}
